import React from "react";
import {Link, RouteWithSubRoutes, Switch} from "../../routes/routeUtil";


function HooksPage({routes}) {


    return (<div>
        <div>
            <ul>
                <li>
                    <Link to={'/hook/state'}>useState</Link>
                </li>
                <li>
                    <Link to={'/hook/effect'}>useEffect</Link>
                </li>
                <li>
                    <Link to={'/hook/custom'}>自定义Hook</Link>
                </li>
                <li>
                    <Link to={'/hook/other'}>其他Hook</Link>
                </li>

            </ul>
            <div className="container">
                <Switch>
                    {routes.map((route, i) => (
                        <RouteWithSubRoutes key={i} {...route} />
                    ))}
                </Switch>
            </div>
        </div>
    </div>)
}

export default HooksPage